package cn.kgb.util;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

public class Alert {
	
	public static void showAlert(HttpServletResponse response,String content){
		try {
			response.setContentType("text/html;charset=UTF-8"); 
			PrintWriter out=response.getWriter();
			StringBuffer sb = new StringBuffer();
			sb.append("<script type=\"text/javascript\">");
			sb.append("alert(\"");
			sb.append(content);
			sb.append("\");");
			sb.append("history.go(-1);");
			sb.append("</script>");
			out.print(sb.toString());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}
